package org.jackysoft.struts2.business;
import java.util.Collection;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.entity.ContractClient;
import org.jackysoft.entity.ProductComeoutItem;
import org.jackysoft.service.ContractClientService;
import org.jackysoft.service.ProductComeoutItemService;
import org.jackysoft.struts2.UtilsCRUDAction;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;



@Namespace("/productcomeoutitem")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class ProductComeoutItemAction extends UtilsCRUDAction<ProductComeoutItem> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7621077198272998037L;
	private ProductComeoutItemService service;
	private ProductComeoutItem bean;
	private Collection<ProductComeoutItem> beans;	
	private Collection<ContractClient> clients;
	private ContractClientService clientService;
	
	public String search() throws Exception{
		beans = service.findAll(search, bean.getFireDate());
		return "search";
	}
	
	public String startoutquery() throws Exception{
		clients = clientService.gets();
		
		return "startoutquery";
	}
	
	public void setBean(ProductComeoutItem bean){
	     this.bean = bean;
	}
	public ProductComeoutItem getBean(){
	     return this.bean;
	}
	public void setBeans(Collection<ProductComeoutItem> beans){
	
	     this.beans = beans;
	}
	public Collection<ProductComeoutItem> getBeans(){
	     return this.beans;
	}
	
	@Resource
	public void setService(ProductComeoutItemService service) {
		this.service = service;
		this.setDataProvider(service);
	}	
	
	public ProductComeoutItemService getService(){
	   return this.service;
	}


	@Resource
	public void setClientService(ContractClientService clientService) {
		this.clientService = clientService;
	}

	
	public Collection<ContractClient> getClients() {
		return clients;
	}

	public void setClients(Collection<ContractClient> clients) {
		this.clients = clients;
	}
		
}